package com.quikin.web.controller.json;

import org.springframework.web.servlet.ModelAndView;

import com.quikin.web.controller.util.ResponseHeader;
import com.von.platform.thridparty.spring.mvc.AbstractController;

public class JsonController extends AbstractController {
    
    @Override
    protected String getErrorViewName() {
        return "json/common/error";
    }

    @Override
    protected String getExceptionStatus() {
        return ResponseHeader.EXCEPTION.name();
    }

    @Override
    protected void createPageInfo(String status, String responseCode, String description, ModelAndView mav) {
        mav.addObject(ResponseHeader.responseStatus.name(),status);
        mav.addObject(ResponseHeader.responseCode.name(), responseCode);
        mav.addObject(ResponseHeader.responseDescription.name(), description);
    }
    
    protected void createSuccessHeaderInfo(ModelAndView mav) {
        mav.addObject(ResponseHeader.responseStatus.name(),ResponseHeader.SUCCESS.name());
        mav.addObject(ResponseHeader.responseCode.name(), "0000");
        mav.addObject(ResponseHeader.responseDescription.name(), ResponseHeader.SUCCESS.name());
    }

}
